/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package network;

import java.util.List;
import weibo4j.Friendships;
import weibo4j.Timeline;
import weibo4j.Weibo;
import weibo4j.model.Paging;
import weibo4j.model.Status;
import weibo4j.model.User;
import weibo4j.model.WeiboException;

/**
 *
 * @author Administrator
 */
public class test2 {

    public static void main(String[] args) throws WeiboException {
        String access = Auth.Auth4Code.getCode();
        String uid, un;

        uid = "2416521620";
        un = "剩女小三";

        uid = "2073754681";
        un = "可惜我是女流氓";

        uid = "2293279954";
        un = "未成年人勿进";

        uid = "1763362173";
        un = "网站分析公会";

        uid = "1657430300";
        un = "创意工坊";

        uid = "2207926475";
        un = "美女私房语";

        uid = "1713926427";
        un = "微博搞笑排行榜";

        uid = "2305056670";
        un = "米可的999封情书";

        uid = "1642635773";
        un = "我们爱讲冷笑话";
       
        Weibo weibo = new Weibo();
        weibo.setToken(access);
         Friendships fm=new Friendships();
        Timeline tm = new Timeline();
        List<Status> status = tm.getUserTimeline(uid, un, 200, new Paging(1, 200), 0, 0);
        status.addAll(tm.getUserTimeline(uid, un, 200, new Paging(2, 200), 0, 0));
        status.addAll(tm.getUserTimeline(uid, un, 200, new Paging(3, 200), 0, 0));
        int rubbish = 0;
        for (Status s : status) {
            String name = s.getSource().getName();
            if (name.equals("皮皮时光机") || name.equals("定时V") || name.equals("时光机")) {
                rubbish += 1;
            }
            System.out.println(name + " " + s.getText());
        }
        int count = status.size();
        System.out.println(count + " " + rubbish);
        if ((double) rubbish / (double) count > 0.25) {
            System.out.println("营销用户");
        }
    }
}
